package com.li.manage.annotation;

import java.lang.reflect.Method;

public class AnnotationTest {

	public static void main(String[] args) {
		Class<?> cls = Apple.class;
		//Field[] fields = cls.getDeclaredFields();
		Method[] methods = cls.getDeclaredMethods();
		if(methods!=null&&methods.length>0){
			for (int i = 0; i < methods.length; i++) {
				Method method = methods[i];
				//Annotation[] annotations = method.getAnnotations();
				LogInterface annotation = method.getAnnotation(LogInterface.class);
				if(annotation!=null){
					System.out.println(annotation.appleColor());
				}
			}
		}
	}

}
